<template>
  <div>
    my {{ x }}
  </div>
</template>

<script>
  export default {
    data() {
      return {
        x: 100
      }
    },
    beforeRouteEnter(to, from, next) {
      next((vm) => {
        console.log(vm.x)
      })
    },
    beforeRouteUpdate() {
      console.log(0)
    },
    beforeRouteLeave (to, from, next) {
      next()
    }
  }
</script>

<style scoped>

</style>